<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>膝关节病变预后列线图打分工具</title>
    <style>
        .container { max-width: 800px; margin: 50px auto; padding: 20px; border: 1px solid #ccc; border-radius: 10px; }
        .form-group { margin: 20px 0; }
        label { display: block; margin-bottom: 8px; font-weight: bold; }
        select { width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #ccc; }
        .result { margin-top: 30px; padding: 20px; background: #f5f5f5; border-radius: 5px; }
        .score { font-size: 24px; color: #d9534f; font-weight: bold; }
        .group { font-size: 20px; color: #337ab7; font-weight: bold; }
        .prob { margin-top: 10px; font-size: 16px; }
        button { padding: 12px 24px; background: #337ab7; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; }
        button:hover { background: #286090; }
    </style>
</head>
<body>
    <div class="container">
        <h1>膝关节弥漫型病变（PVNS）预后评分工具</h1>
        <form id="scoreForm">
            <!-- 年龄 -->
            <div class="form-group">
                <label for="age">1. 年龄（岁）</label>
                <select id="age" required>
                    <option value="0">≤25</option>
                    <option value="10">26-35</option>
                    <option value="30">36-45</option>
                    <option value="50">46-55</option>
                    <option value="70">56-65</option>
                    <option value="100">≥66</option>
                </select>
            </div>
            <!-- 复发史 -->
            <div class="form-group">
                <label for="recurrence">2. 复发史</label>
                <select id="recurrence" required>
                    <option value="0">否</option>
                    <option value="50">是</option>
                </select>
            </div>
            <!-- 肿瘤广泛浸润 -->
            <div class="form-group">
                <label for="invasion">3. 肿瘤广泛浸润</label>
                <select id="invasion" required>
                    <option value="0">否</option>
                    <option value="40">是</option>
                </select>
            </div>
            <!-- 骨侵蚀 -->
            <div class="form-group">
                <label for="boneErosion">4. 骨侵蚀</label>
                <select id="boneErosion" required>
                    <option value="0">否</option>
                    <option value="30">是</option>
                </select>
            </div>
            <!-- 手术方式 -->
            <div class="form-group">
                <label for="surgery">5. 手术方式</label>
                <select id="surgery" required>
                    <option value="0">开放联合关节镜</option>
                    <option value="20">关节镜滑膜切除</option>
                    <option value="50">开放性滑膜切除</option>
                </select>
            </div>
            <button type="submit">计算评分与危险分组</button>
        </form>

        <div class="result" id="result" style="display: none;">
            <h3>评分结果</h3>
            <p>总得分：<span class="score" id="totalScore"></span> 分</p>
            <p>危险分组：<span class="group" id="riskGroup"></span></p>
            <div class="prob" id="survivalProb"></div>
        </div>
    </div>

    <script>
        document.getElementById("scoreForm").addEventListener("submit", function(e) {
            e.preventDefault(); // 阻止表单刷新
            // 获取各变量评分
            const age = parseInt(document.getElementById("age").value);
            const recurrence = parseInt(document.getElementById("recurrence").value);
            const invasion = parseInt(document.getElementById("invasion").value);
            const boneErosion = parseInt(document.getElementById("boneErosion").value);
            const surgery = parseInt(document.getElementById("surgery").value);
            // 计算总得分
            const total = age + recurrence + invasion + boneErosion + surgery;
            // 确定危险分组与生存概率
            let riskGroup, prob;
            if (total <= 80) {
                riskGroup = "低危";
                prob = "预期1年无进展生存率≥90%，3年≥85%，5年≥80%";
            } else if (total <= 160) {
                riskGroup = "中危";
                prob = "预期1年无进展生存率70%-90%，3年60%-85%，5年50%-80%";
            } else {
                riskGroup = "高危";
                prob = "预期1年无进展生存率<70%，3年<60%，5年<50%";
            }
            // 显示结果
            document.getElementById("totalScore").textContent = total;
            document.getElementById("riskGroup").textContent = riskGroup;
            document.getElementById("survivalProb").textContent = prob;
            document.getElementById("result").style.display = "block";
        });
    </script>
</body>
</html>